package com.keta.foundation.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.keta.foundation.dao.RolePermissionDAO;
import com.keta.foundation.entity.RolePermission;
import com.keta.foundation.service.RolePermissionService;

@Service
@Transactional
public class RolePermissionServiceImpl implements RolePermissionService {

	@Autowired
	private RolePermissionDAO rolePermissionDAO;

	@Override
	public void save(RolePermission rolePermission) {
		rolePermissionDAO.save(rolePermission);
	}

	@Override
	public void save(List<RolePermission> rolePermissions) {
		rolePermissionDAO.save(rolePermissions);
	}

	@Override
	public void delete(RolePermission rolePermission) {
		rolePermissionDAO.delete(rolePermission);
	}

	@Override
	public void delete(List<RolePermission> rolePermissions) {
		rolePermissionDAO.delete(rolePermissions);
	}

	@Override
	public List<RolePermission> getByRoleId(Long roleId) {
		return rolePermissionDAO.findByRoleId(roleId);
	}

}
